import { TaskType } from 'src/schemas/user.schema';

export enum ChatSendType {
  PRIVATE_CHAT = 0,
  GROUP_CHAT = 1,
}

interface ChatSendMessageData {
  user_id: string;
  id: string;
  text: string;
  time: string;
}

export interface ChatSendMessage {
  event: string;
  type: ChatSendType;
  data: ChatSendMessageData;
}

// 向对方发送好友请求
export interface AddFriendSendMessage {
  event: string;
  type: TaskType;
  data: {
    // 自己的唯一id，便于对方知道是谁加的好友
    id: string;
  };
}
// 处理对方的好友请求后，向对方发送同意还是拒绝
export interface DealWithAddFriendSendMessage {
  event: string;
  type: TaskType;
  data: {
    // 同意或者拒绝对方后，要让对方知道，是谁拒绝了他/她
    id: string;
    agreed: boolean;
  };
}
